package cn.iocoder.yudao.module.infrastructure.messy.controller.admin;

import cn.iocoder.yudao.framework.business.monitor.pojo.ServerInfo;
import cn.iocoder.yudao.framework.business.monitor.service.MonitorService;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  服务器监视
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @author ruoyi
 * @since 2024/04/21
 */
@Tag(name = "管理后台 - 服务器监视")
@RestController
@RequestMapping("/infra/monitor")
public class MonitorController {
    @Resource
    private MonitorService monitorService;

    @GetMapping("/server-info")
    @PreAuthorize("@ss.hasPermission('infra:monitor:server-info')")
    public CommonResult<ServerInfo> getServerInfo() {
        return CommonResult.success(monitorService.getServerInfo());
    }

}
